print('Введите скобки:')
d=input()
a='(){}[]<>'
s=''
for el in d:
    if el in a:
        s+=el

while '()'in s or '{}' in s or '[]' in s or '<>' in s :
    s=s.replace('()','')
    s=s.replace('{}','')
    s=s.replace('[]','')
    s=s.replace('<>','')
  
    

if s=='':
    print('True')
else:
    print('False')